<?php

class Asset_Model_LiabilityFormField extends WOW_Model_Acl_Abstract
{
    public function getResourceId()
    {
        return 'LiabilityFormField';
    }

    public function getFormFieldById($id)
    {
        $id = (int) $id;
        return $this->getResource('LiabilityFormField')->getFormFieldById($id);
    }

     public function getAllFormFieldsArray()
    {
        $all_fields  = $this->getResource('AssetFormField')->getAllFormFields();

        $ret_ar = array();
        foreach($all_fields as $field)
        {
            $ret_ar[$field->id] = array(
                                        'catid'     => $field->catid,
                                        'subcatid'  => $field->subcatid,
                                        'labelid'   => $field->AssetCatLabelId,
                                        'field_name'=> $field->FieldName,
                                        'is_required'=> $field->isRequired,
                                        'input_validation'=>$field->InputValidation,
                                        'length'    => $field->Length,
                                        'input_type' => $field->InputType
                                        );
        }

        return $ret_ar;
    }


    public function getFormFieldByCategorySubcategoryLabel($catid, $subcat_id, $labelid)
    {
        $flds = $this->getResource('AssetFormField')->getFormFieldByCategorySubcategoryLabel($catid, $subcat_id, $labelid);


        $ret_ar = array();
        foreach($flds as $field)
        {
            $ret_ar[$field->id] = array(
                                        'catid'     => $field->catid,
                                        'subcatid'  => $field->subcatid,
                                        'labelid'   => $field->AssetCatLabelId,
                                        'field_name'=> $field->FieldName,
                                        'is_required'=> $field->isRequired,
                                        'input_validation'=>$field->InputValidation,
                                        'length'    => $field->Length,
                                        'input_type' => $field->InputType
                                        );
        }

        return $ret_ar;


    }
    
}

?>
